//
//  LJFWedController.m
//  SevenZhou
//
//  Created by qianfeng on 15/9/21.
//  Copyright (c) 2015年 ljf. All rights reserved.
//

#import "LJFWedController.h"
#import "LJFCustomController.h"
#import "MBProgressHUD.h"

@interface LJFWedController ()<UIWebViewDelegate>
{
   // MBProgressHUD *_HUD;
}

@property (weak, nonatomic) IBOutlet UIWebView *webView;


@end

@implementation LJFWedController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    [self hiddenTabar];
    [self loadWed];

}

//- (void)showProgress
//{
//    _HUD = [[MBProgressHUD alloc] initWithView:self.view];
//    _HUD.labelText = @"正在努力加载中";
//    
//    [self.view addSubview:_HUD];
//    
//    [_HUD show:YES];
//    
//}

- (void)hiddenTabar
{
    LJFCustomController *tabar = (LJFCustomController *)self.tabBarController;
    tabar.tabBarView.hidden = YES;
}

- (void)showTabar
{
    LJFCustomController *tabar = (LJFCustomController *)self.tabBarController;
    tabar.tabBarView.hidden = NO;
}

- (void)loadWed
{
    
    self.automaticallyAdjustsScrollViewInsets = NO;
    
//    _webView.delegate = self;
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    NSURL *url = [NSURL URLWithString:_urlString];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    
    [_webView loadRequest:request];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)back:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
    [self showTabar];
}

//#pragma mark -UIWebViewDelegate
//
//-(void)webViewDidFinishLoad:(UIWebView *)webView
//{
//    [_HUD hide:YES];
//}
//
//-(void)webViewDidStartLoad:(UIWebView *)webView
//{
//    [self showProgress];
//}
//
//-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
//{
//    [_HUD hide:YES];
//}
//
//-(void)dealloc
//{
//    [_HUD removeFromSuperview];
//    _HUD = nil;
//}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
